package com.spzx.product.service.impl;

import com.spzx.product.api.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BrandServiceImpl implements IBrandService {

    @Autowired
    BrandMapper brandMapper;

    @Override
    public List<Brand> list(Brand brand) {
        return brandMapper.list(brand);
    }

    @Override
    public Brand getById(Long id) {
        return brandMapper.getById(id);
    }

    @Override
    public int save(Brand brand) {
        return brandMapper.insert(brand);
    }

    @Override
    public int updateById(Brand brand) {
        return brandMapper.updateById(brand);
    }

    @Override
    public int deleteBatch(Long[] ids) {
        return brandMapper.deleteBatch(ids);
    }

    @Override
    public List<Brand> getBrandAll() {
        return brandMapper.getBrandAll();
    }
}
